# coding=utf-8

from flask import current_app, jsonify, request
from app.get_task_datas import update_param
from . import main
from config import config


# 积分生效前修改参数
@main.route('/update_score_effect_param_1', methods=['POST', 'GET'])
def update_score_effect_param_1():
    param = request.form.get("param")
    current_app.logger.info('This is update_score_effect_param_1 %s', param)
    praSql = config['default'].UPDATE_SCORE_EFFECT_PARAM_SQL
    check_result = update_param(param, praSql)
    return jsonify({'result': check_result})


# 积分生效后修改参数
@main.route('/update_score_effect_param_0', methods=['POST', 'GET'])
def update_score_effect_param_0():
    param = request.form.get("param")
    current_app.logger.info('This is update_score_effect_param_0')
    praSql = config['default'].UPDATE_SCORE_EFFECT_PARAM_SQL
    check_result = update_param(param, praSql)
    return jsonify({'result': check_result})
